<% content_for :header do -%>
  <%= stylesheet_link_tag    "jquery.autocomplete.css", "token-input" %>
  <%= javascript_include_tag "jquery.ui.autocomplete", "jquery.tokeninput" %>
  <script type="text/javascript">
    $(document).ready(function() {
      $('#user_specs').tokenInput("<%= speciality_autocomplete_path %>.json", {
        crossDomain: false,
        prePopulate: $("#user_specs").data("pre"),
      });
    });
  </script>
  
<% end -%>
<div id="new-idea">
  <h2>Sign up</h2>

  <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name),:html => {:id => "add-form"}) do |f| %>
    <% if resource.errors.any? %>
      <div class="message error_message">
        <h2><%= pluralize(resource.errors.count, "error") %> prohibited this idea from being saved:</h2>

        <ul>
        <% resource.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
        </ul>
      </div>
    <% end %>
    <div class="inputs">
      <p>
        <%= f.label :email %>
        <%= f.text_field :email, :autofocus => true %>
      </p>
      <p>
        <%= f.label :password %>
        <%= f.password_field :password %>
      </p>
      <p>
        <%= f.label :password_confirmation %>
        <%= f.password_field :password_confirmation%>
      </p>
      <p>
        <%= f.label :specialities %>
        <%= f.text_field :specs, "data-pre" => resource.specs %>
      </p>
    </div>

    <div class="actions">
      <%= f.submit "Sign up" %>
    </div>
  <% end %>

  <%= render :partial => "devise/shared/links" %>
</div>
